From c1c00e44dbc85f86c3c725602ed69183152b38d5 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Fri, 12 Jul 2013 21:43:31 +0000 Subject: [PATCH] Speed GPX writer by 19% by removing implicit time_t conversion in a test that I'm not convinced matters anyway. ('exported' seems really weird.) --- gpsbabel/gpx.cc | 2 +- gpsbabel/tpo.cc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gpsbabel/gpx.cc b/gpsbabel/gpx.cc index dcc878e19..68d38813a 100644 --- a/gpsbabel/gpx.cc +++ b/gpsbabel/gpx.cc @@ -1441,7 +1441,7 @@ fprint_xml_chain(xml_tag* tag, const waypoint* wpt) if (tag->child) { fprint_xml_chain(tag->child, wpt); } - if (wpt && wpt->gc_data->exported && + if (wpt && wpt->gc_data->exported.isValid() && strcmp(tag->tagname, "groundspeak:cache") == 0) { writer.writeTextElement("time", wpt->gc_data->exported.toPrettyString()); diff --git a/gpsbabel/tpo.cc b/gpsbabel/tpo.cc index a3638f0bf..e5f366cb2 100644 --- a/gpsbabel/tpo.cc +++ b/gpsbabel/tpo.cc @@ -556,7 +556,8 @@ void tpo_process_tracks(void) } char style_name[track_style_count][TRACKNAMELENGTH]; // some huge value int style_color[track_style_count][3]; // keep R/G/B values separate because line_color needs BGR - int style_wide[track_style_count],style_dash[track_style_count]; + int style_wide[track_style_count]; + int *style_dash = (int*) xcalloc(sizeof(int), track_style_count); for (ii = 0; ii < track_style_count; ii++) { // clumsy way to skip two undefined bytes -- 2.30.2